package com.zz.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zz.common.R;
import com.zz.entity.Club;
import com.zz.entity.User;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;

public interface UserService extends IService<User> {
    //根据用户名得到用户信息
    User getUserInfoByName(String name);

    List<String> getUserRoleInfo(String principal);

    List<String> getUserPermissionInfo(List<String> roles);

    /**
    * 用户注册
    * */
    R<String> register(User user);

    /**
    * 忘记/重置密码,AES数据加密
    * */
    R<String> resetPassword(@RequestBody @Valid Map<String, String> map);

    /**
    * 修改个人信息,学号不允许修改
    * */
    R<String> update(@RequestBody User user, HttpServletRequest request);

    /**
    * 个人信息展示,前端不需要传参数
    * */
    R<User> info(HttpServletRequest request);

    /**
    * 展示用户已参加社团,前端不需要传参数
    * */
    R<List<Club>> club(HttpServletRequest request);

    /**
    * 个人中心修改密码
    * */
    R<String> changePassword(@RequestBody Map<String,String> map, HttpServletRequest request);
}
